package com.ywjt.platformbusiness.cart.adapter;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.cart.CartListModel;

import java.util.ArrayList;
import java.util.List;

public class CartStoreAdapter extends BaseQuickAdapter<CartListModel.ResultDTO, BaseViewHolder> {

    public CartStoreAdapter(@Nullable List<CartListModel.ResultDTO> data) {
        super(R.layout.item_cart_p, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CartListModel.ResultDTO item) {

        helper.setText(R.id.tvShopName,item.getShopInformation().getShopName());
        RecyclerView rcCart=helper.getView(R.id.rcCart);

        CartGoodsAdapter adapter=new CartGoodsAdapter(item.getShopCartList());
        rcCart.setAdapter(adapter);
        rcCart.setLayoutManager(new LinearLayoutManager(mContext));

    }
}
